﻿using System;
using System.Collections.Generic;
using System.Text;
using UnityEngine;
using System.Threading.Tasks;

/// <summary>
/// 单列模板
/// </summary>
/// <typeparam name="T"></typeparam>
public class MonoSingleton<T> : MonoBehaviour
    where T: MonoBehaviour
{
    private static T Instance; 
    public static T instance
    {
        get { return Instance; }
        set { Instance = value; }
    }

    protected virtual void Awake()
    {
        instance = this as T;
    }
}